<template>
    <div class="dson">
        <div class="dian-item" v-for="(item,index) in dson" :key="index">
            <div class="top">
                <img :src="item.top" alt="">
            </div>
            <div class="middle">
                <div class="item" v-for="(item1,index1) in item.middle" :key="index1">
                    <div class="img">
                        <img :src="item1.imgsrc" alt="">
                    </div>
                    <div class="info">
                        <div class="name">{{item1.name}}</div>
                        <div class="brief">{{item1.brief}}</div>
                        <div class="price">
                            <span>￥{{item1.newPrice}}起</span>
                            <span class="price old" v-if="item1.oldPrice">￥<s>{{item1.oldPrice}}</s></span></div>
                        <div class="buybtn mauto"> 立即购买</div>
                    </div>
                </div>
            </div>
            <div class="bot">
                <div class="item" v-for="(item2,index2) in item.bot" :key="index2">
                    <div class="img">
                        <img :src="item2.imgsrc" alt="">
                    </div>
                    <div class="info-box">
                        <div class="name">{{item2.name}}</div>
                        <div class="brief">{{item2.brief}}</div>
                        <div class="price">
                            <span>￥{{item2.newPrice}}</span>
                            <span class="price old" v-if="item2.oldPrice">￥<s>{{item2.oldPrice}}</s></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name:"Dson",
    props:['dson'],
}
</script>

<style lang="less" scoped>
.dian-item{
   width: 7.2rem;
   background: rgb(255, 174, 153);
   .top,.middle{
       margin-bottom: 0.16rem;
   }
   .middle,.bot{
        display: flex;
        flex-wrap: wrap;
        box-sizing: border-box;
        justify-content: space-between;
        padding: 0 0.12rem;
   }
   .middle{
       .item{
            width: 3.42rem;
            box-sizing: border-box;
            border-radius: .1rem;
            background: #fff;
            overflow: hidden;
            .img{
                overflow: hidden;
                img{
                    width: 3.44rem;
                    height: 2.8rem;
                }
            }
            .info{
                padding: .2rem .27rem;
                text-align: center;
                .name{
                    font-size: .28rem;
                    color: rgba(0,0,0,.87);
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
                .brief{
                    margin-top: .06rem;
                    font-size: .22rem;
                    line-height: .3rem;
                    color: rgba(0,0,0,.54);
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
                .price{
                    font-size: .28rem;
                    color: #ea625b;
                    height: 1.5em;
                    line-height: 1.5em;
                    position: relative;
                    display: inline-block;
                    .old{
                        display: inline-block;
                        margin: 0 .1rem;
                        font-size: .22rem;
                        color: rgba(0,0,0,.54);
                        s{
                            text-decoration: line-through;
                        }
                    }
                }
                .buybtn{
                    width: 2rem;
                    background: #ea625b;
                    border-radius: .05rem;
                    text-align: center;
                    color: #fff;
                    font-size: .24rem;
                    padding: .16rem 0;
                    font-weight: 700;
                    margin: 0 auto;
                }
            }
       }
   }
   .bot{
       width: 100%;
       .item{
            width: 2.21rem;
            border-radius: .06rem;
            overflow: hidden;
            background: #fff;
            margin-bottom: 0.16rem;
            .img{
                position: relative;
                overflow: hidden;
                width: 2.21rem;
                height: 2.21rem;
            }
            .info-box{
                height: auto;
                padding: .2rem .1rem;
                text-align: center;
                overflow: hidden;
                color:#000;
                .name{
                    font-size: .24rem;
                    padding: 0 .12rem;
                    font-weight: bolder;
                    color: #3c3c3c;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
                .brief{
                    font-size: .2rem;
                    line-height: 1.6em;
                    color: #3c3c3c;
                    height: 1.5em;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
                .price{
                    font-size: .28rem;
                    color: #ea625b;
                    height: 1.5em;
                    line-height: 1.5em;
                    position: relative;
                    display: inline-block;
                    .old{
                        display: inline-block;
                        margin: 0 .1rem;
                        font-size: .22rem;
                        color: rgba(0,0,0,.54);
                        s{
                            text-decoration: line-through;
                        }
                    }
                }
            }
       }
   }
   img{
       width: 100%;
       height: 100%;
   }
}
</style>